<html>	
<head>
<title>Coalition Server</title>
<script src="jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="/jsolait/jsolait.js"></script>
<script type="text/javascript">jsolait.baseURI="/jsolait";</script>
<script src="coalition.js"></script>
<link href="coalition.css" rel="stylesheet" type="text/css"></link>
</head>

<body>
<div id="header">
    <div id="maintitle"><a href="http://code.google.com/p/coalition/">Coalition</a></div>
    <div id="subtitle">- A small but beautiful job manager by <a href="http://www.mercenaries-engineering.com">Mercenaries Engineering</a> - GPL licence - <a href="iphone.html">iPhone</a></div>

    <div id="tabs">
            <div id="jobtab" class="activetab" onclick='showJobs()'>Jobs</div>
            <div id="workertab" class="unactivetab" onclick='showWorkers()'>Workers</div>
            <div id="activitytab" class="unactivetab" onclick='showActivities()'>Activities</div>
            <div id="logtab" class="unactivetab" onclick='showLog ()'>Log</div>
    </div>

    <div class="refreshtools">
        <input id="autorefresh" class="auto" type="checkbox">auto</input>
        <input type="button" id="refreshbutton" class="refreshbutton" onclick='refresh()' value='Refresh'/>
    </div>
        
</div>

<div id="main">
    <div id="jobsTab">
        <div id="jobtools">
            <div class='button' id='Div1'>Filter
                <select id='filterJobs' onchange='javascript:reloadJobs ()'>
                    <option value='NONE'>NONE</option>
                    <option value='WORKING'>WORKING</option>
                    <option value='ERROR'>ERROR</option>
                    <option value='WAITING'>WAITING</option>
                    <option value='FINISHED'>FINISHED</option>
                    <option value='PAUSED'>PAUSED</option>
                </select></div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b01''>Select
                <select id='selectJobs' onchange='javascript:selectJobs ()' value='CUSTOM'>
                    <option value='NONE'>NONE</option>
                    <option value='ALL'>ALL</option>
                    <option value='WORKING'>WORKING</option>
                    <option value='ERROR'>ERROR</option>
                    <option value='WAITING'>WAITING</option>
                    <option value='FINISHED'>FINISHED</option>
                    <option value='PAUSED'>PAUSED</option>
                    <option value='CUSTOM'>CUSTOM</option>
                </select></div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b03' onclick='resetSelection()'><img src='icon_refresh.png' /> Reset</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b04' onclick='resetErrorSelection()'><img src='icon_refresh.png' /> Reset Errors</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b05' onclick='startSelection()'><img src='icon_play.png' /> Start</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b06' onclick='pauseSelection()'><img src='icon_pause.png' /> Pause</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b07' onclick='cutSelection()'><img src='icon_cut.png' /> Cut</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b11' onclick='pasteSelection()'><img src='icon_paste.png' /> Paste</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b03' onclick='removeSelection()'><img src='icon_remove.png' /> Delete</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b08' onclick='logSelection()'><img src='icon_logs.png' /> Log</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b09' onclick='jobActivity()'><img src='icon_activity.png' /> Activity</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b10' onclick='exportCSV()'><img src='icon_tabler.png' /> CSV</div>
        </div>
        <div id="parents">
        </div>
        <div id="jobs">
        </div>

        <table id="toolstable">
        <tr>
        <td class="ttr1">Title:</td><td class="ttr2"><input type='edit' class="ttedit" id='title' name='title' value='Job' onchange='onchangejobprop ("title")'></td>
        <td class="ttr3">Priority:</td><td class="ttr4"><input type='edit' class="ttedit" id='priority' name='priority' value='1000' onchange='onchangejobprop ("priority")'></td>
        <td rowspan=4 id="toolbuttons">
            <div>
                <input type='button' class='toolbutton' name='updatejobsButton' value='Update' onclick='updatejobs()' />
                <input type='button' class='toolbutton' name='addjobButton' value='Add job' onclick='addjob()' />
            </div>
        </td></tr>
        <tr>
        <td class="ttr1">Command:</td><td><input type='edit' class="ttedit" id='cmd' name='cmd' value='' onchange='onchangejobprop ("cmd")'></td>
        <td class="ttr3">TimeOut:</td><td><input type='edit' class="ttedit" id='timeout' name='timeout' value='0' onchange='onchangejobprop ("timeout")'></td>
        <tr>
        <td class="ttr1">Directory:</td><td><input type='edit' class="ttedit" id='dir' name='dir' value='.' onchange='onchangejobprop ("dir")'></td>
        <td class="ttr3">Affinity:</td><td><input type='edit' class="ttedit" id='affinity' name='affinity' value='' onchange='onchangejobprop ("affinity")'></td>
        </tr>
        <tr>
        <td class="ttr1">Dependencies:</td><td><input type='edit' class="ttedit" id='dependencies' name='dependencies' value='' onchange='onchangejobprop ("dependencies")'></td>
        <td class="ttr3">Retry:</td><td><input type='edit' class="ttedit" id='retry' name='retry' value='10' onchange='onchangejobprop ("retry")'></td>
        </tr>
        <tr>
        <td class="ttr1">URL:</td><td><input type='edit' class="ttedit" id='url' name='url' value='' onchange='onchangejobprop ("url")'></td>
        <td class="ttr3">User:</td><td><input type='edit' class="ttedit" id='user' name='user' value='' onchange='onchangejobprop ("user")'></td>
        </tr>
        <tr>
        <td class="ttr1">Environment:</td><td><input type='edit' class="ttedit" id='env' name='env' value='' onchange='onchangejobprop ("env")'></td>
        </tr>
        </table>
    </div>
    <div id="workersTab">
        <div id="workertools">
            <div class='button' id='b06' onclick='selectAll (true)'><img src='icon_select.png' /> Select All</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b07' onclick='selectAll (false)'><img src='icon_none.png' /> Select None</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b09' onclick='startWorkers ()'><img src='icon_play.png' /> Start</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b10' onclick='stopWorkers ()'><img src='icon_pause.png' /> Stop</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b08' onclick='clearWorkers ()'><img src='icon_remove.png' /> Delete</div>
            <div class='buttonSep'>|</div>
            <div class='button' id='b11' onclick='workerActivity ()'><img src='icon_activity.png' /> Activity</div>
        </div>
        <div id="workers">
        </div>

        <table id="workertoolstable">
        <tr>
        <td class="ttr3">Affinity:</td><td><input type='edit' class="ttedit" id='waffinity' name='waffinity' value='' onchange='onchangeworkerprop ("waffinity")'></td>
        <td rowspan=4>
            <div>
                <input type='button' class='toolbutton' name='updatejobsButton' value='Update' onclick='updateworkers()' />
            </div>
        </td></tr>
        </table>
    </div>
    <div id="logsTab">
        <div id="logtools">
            <div class='button' id='b12' onclick='clearLog()'><img src='icon_remove.png' /> Clear</div>
        </div>
        <div id="logs">
        </div>
    </div>
    <div id="activitiesTab">
        <div id="activitiestools">
            <div class='button' id='Div2'>Job filter
                <input id='activityJob' onchange='javascript:reloadActivities()'>
                </input></div>
            <div class='buttonSep'>|</div>
            <div class='button' id='Div3'>Worker filter
                <input id='activityWorker' onchange='javascript:reloadActivities()'>
                </input></div>
            <div class='buttonSep'>|</div>
            <div class='button' id='Div4'>How long
                <select id='howlong' onchange='javascript:reloadActivities()'>
                    <option value='60'>Last minute</option>
                    <option value='600'>Last 10 minutes</option>
                    <option value='3600'>Last hour</option>
                    <option value='28800'>Last 8 hours</option>
                    <option value='86400'>Last day</option>
                    <option value='604800'>Last week</option>
                    <option value='2592000'>Last month</option>
                    <option value='15552000'>Last 6 monthes</option>
                    <option value='100000000000'>All</option>
                </select></div>
        </div>
        <div id="activities">
        </div>
    </div>
</div>

</body>
</html>

